/********************************************************************

Define common math exceptions.

Write Date: 2011/03/23
Author: Deng Nianchen
>>>> The file contains following classes:
>>>> MathException
>>>> DivideZeroException

Modify Date: 2015/08/17
Author: Apple
>>>> Update the code and comment style.
>>>> Rename MathExceptions.hpp to MathExceptions.h to match the file naming
     convention.

*********************************************************************/
#pragma once
#include "OOPException.h"



_NS_OOP_BEGIN



/**
 * Exception for signalling general mathematics errors.
 *
 * @remarks 2011/3/24, Apple
 */
class MathException : public OOPException
{
public:

	virtual QString getReson () {
		return QString::fromLocal8Bit ("Unknown math exception.");
	}

};



/**
 * Exception for signalling divid-zero errors.
 *
 * @remarks 2015/08/17, Apple
 */
class DividZeroException : public MathException
{
public:

	virtual QString getReson () {
		return QString::fromLocal8Bit ("Cannot divide 0.");
	}

};



_NS_OOP_END